% To run load a Prolog system (e.g. yap, sicstus or swi) and consult:
% ?- [priolog,past].
%
% then query for, e.g.:
%
%   prove(past([f,r,y],[f,r,i,e,d]), A, P).
%   hyp(past([g,o],[w,e,n,t]), H, A, P).
%   hyp(past([f,r,y],[f,r,i,e,d]), H, A, P).
%   hyp(past([b,a,n,g],[b,a,n,g,e,d]), H, A, P).
%   hyp(past([k,e,e,p],[k,e,p,t]), H, A, P).
%   hyp(past([s,l,e,e,p],[s,l,e,p,t]), H, A, P).

:-set(maximum_literals_in_hypothesis,2).
:-set(example_inflation, 10).

split([L|W],[L],W).
split([L|W1],[L|W2],W3) :- split(W1,W2,W3).

:-modeh(past(+word,-word)).
:-modeb(split(+word,-word,#word),2).
:-modeb(split(-word,+word,#word)).

% prove(past([f,r,y],[f,r,i,e,d]), P, A).
% hyp(past([f,r,y],[f,r,i,e,d]), H, A, P).

% examples:

example(past([f,r,y],[f,r,i,e,d]), 1).
example(past([s,l,e,e,p],[s,l,e,p,t]), 1).
example(past([d,r,i,n,k],[d,r,a,n,k]), 1).
example(past([s,i,n,k],[s,a,n,k]), 1).
example(past([h,a,n,g],[h,a,n,g,e,d]), 1).
example(past([b,a,n,g],[b,a,n,g,e,d]), 1).
example(past([a,i,m],[a,i,m,e,d]), 1).
example(past([c,r,y],[c,r,i,e,d]), 1).
example(past([c,r,a,c,k],[c,r,a,c,k,e,d]), 1).
example(past([t,r,y],[t,r,i,d]), 1).
example(past([b,u,i,l,d],[b,u,i,l,t]), 1).
example(past([f,i,l,l],[f,i,l,l,e,d]), 1).
example(past([b,a,k,e],[b,a,k,e,d]), 1).
example(past([b,l,i,n,k],[b,l,i,n,k,e,d]), 1).
example(past([b,a,n,g],[b,a,n,g,e,d]), 1).
example(past([w,i,n,k],[w,i,n,k,e,d]), 1).
example(past([t,r,a,c,k],[t,r,a,c,k,e,d]), 1).
example(past([b,e,n,d],[b,e,n,t]), 1).
example(past([w,e,e,p],[w,e,p,t]), 1).
example(past([s,e,n,d],[s,e,n,t]), 1).
example(past([s,e,l,l],[s,o,l,d]), 1).
example(past([d,r,y],[d,r,i,e,d]), 1).
example(past([t,e,l,l],[t,o,l,d]), 1).
example(past([k,e,e,p],[k,e,p,t]), 1).
example(past([s,e,e],[s,a,w]), 1).
example(past([f,r,e,e],[f,r,e,e,d]), 1).
example(past([g,o],[w,e,n,t]), 1).
example(past([p,o,i,n,t],[p,o,i,n,t,e,d]), 1).
example(past([b,u,c,k,l,e],[b,u,c,k,l,e,d]), 1).
example(past([s,u,c,k,l,e],[s,u,c,k,l,e,d]), 1).
example(past([b,e,l,t],[b,e,l,t,e,d]), 1).
example(past([m,i,l,l],[m,i,l,l,e,d]), 1).
example(past([b,o,r,e],[b,o,r,e,d]), 1).

%:-start,findall(H, hyp(past([f,r,y],[f,r,i,e,d]), H, A, P), L),length(L, N), write(L),nl, write(N),nl,statistics.
